<?php
namespace BP\Sys;

use BP\En\EntityNoName;

require_once("BP/DA/DataType.php");
require_once("BP/En/Map.php");
class ExcelFile extends EntityNoName {
	public function getMark () 
	{
		return $this->GetValStrByKey(ExcelFileAttr::$Mark);
	}
	public function setMark ($value) // [String value]
	{
		$this->SetValByKey(ExcelFileAttr::$Mark, $value);
	}
	public function getExcelType () 
	{
		return ExcelType->forValue($this->GetValIntByKey(ExcelFileAttr::$ExcelType));
	}
	public function setExcelType ($value) // [ExcelType value]
	{
		$this->SetValByKey(ExcelFileAttr::$ExcelType, $value);
	}
	public function getNote () 
	{
		return $this->GetValStrByKey(ExcelFileAttr::$Note);
	}
	public function setNote ($value) // [String value]
	{
		$this->SetValByKey(ExcelFileAttr::$Note, $value);
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public static function constructor__String ($no) // [String no]
	{
		$me = new self();
		$me->Retrieve(ExcelFileAttr::$No, $no);
		return $me;
	}
	public function getHisUAC () 
	{
		$uac = new UAC();
		$uac->OpenAll();
		return $uac;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_ExcelFile");
		$map->setEnDesc("Excel模板");
		$map->AddTBStringPK(ExcelFileAttr::$No, NULL, "编号",  TRUE ,  TRUE , 1, 36, 200);
		$map->AddTBString(ExcelFileAttr::$Name, NULL, "名称",  TRUE ,  FALSE , 1, 50, 100,  TRUE );
		$map->AddTBString(ExcelFileAttr::$Mark, NULL, "标识",  TRUE ,  FALSE , 1, 50, 100);
		$map->AddDDLSysEnum(ExcelFileAttr::$ExcelType, 0, "类型",  TRUE ,  TRUE , ExcelFileAttr::$ExcelType, "@0=普�?�文件数据提取@1=流程附件数据提取");
		$map->AddTBStringDoc(ExcelFileAttr::$Note, NULL, "上传说明",  TRUE ,  FALSE ,  TRUE );
		$map->AddSearchAttr(ExcelFileAttr::$ExcelType);
		$map->AddMyFile("模板文件", "*.xls|*.xlsx");
		$rm = new RefMethod();
		$rm->Title = "模板配置";
		$rm->ClassMethodName = ($this . ".ExcelConfig");
		$rm->refMethodType = $RefMethodType->RightFrameOpen;
		$map->AddRefMethod($rm);
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	public function ExcelConfig () 
	{
		return ((SystemConfig::getCCFlowWebPath() . "WF/Admin/ExcelUploadConfig.htm?No=") . $this->getNo());
	}
	protected function beforeInsert () 
	{
		$this->setNo($UUID->randomUUID());
		return parent->beforeInsert();
	}
	protected function beforeUpdateInsertAction () 
	{
		if ($DataType->IsNullOrEmpty($this->getMark()))
		{
			$this->setMark($BP->Tools->chs2py->ConvertStr2Code($this->getName()));
		}
		return parent->beforeUpdateInsertAction();
	}
}
?>
